home *** CD-ROM | disk | FTP | other *** search
/ Ass Troids / Ass Troids.iso / pc / pc / juice21.dxr / Internal_16_birthGrenade.ls < prev    next >
Encoding:
Text File  |  1996-11-07  |  2.0 KB  |  65 lines

  1. property ancestor, PchangeUp, PchangeHor, PpixCounter, Ppix, PmySprite, Pjump, Pdelay
  2. global GgrenadeSprite, GbulletOffset, gScreenObjectList, Gscore1
  3.  
  4. on birth me, whichSprite
  5.   set ancestor to birth(script "animateObjects", GbulletOffset)
  6.   set Pdelay to the ticks + 3
  7.   set height to the locV of sprite whichSprite - 50
  8.   set Pjump to (350 + height) / 10
  9.   set PchangeUp to height / Pjump
  10.   set PchangeHor to (the locH of sprite whichSprite - 320) / 10
  11.   set PpixCounter to 1
  12.   set Ppix to [201, 202, 203, 204, 205, 206, 207, 208, 209, 200, 201, 202]
  13.   set PmySprite to GbulletOffset
  14.   set the memberNum of sprite PmySprite to 201
  15.   set the locH of sprite PmySprite to the locH of sprite whichSprite
  16.   set the locV of sprite PmySprite to the locV of sprite whichSprite - 50
  17.   return me
  18. end
  19.  
  20. on move me
  21.   if the ticks > Pdelay then
  22.     set the memberNum of sprite PmySprite to getAt(Ppix, PpixCounter)
  23.     if PpixCounter = (PchangeUp + 1) then
  24.       set Pjump to -Pjump
  25.     end if
  26.     set the locH of sprite PmySprite to the locH of sprite PmySprite - PchangeHor
  27.     set the locV of sprite PmySprite to the locV of sprite PmySprite - Pjump
  28.     set PpixCounter to PpixCounter + 1
  29.     if PpixCounter = 12 then
  30.       explode()
  31.       set the locH of sprite PmySprite to -500
  32.       deleteProp(gScreenObjectList, PmySprite)
  33.       set GbulletOffset to GbulletOffset - 1
  34.     end if
  35.     set Pdelay to the ticks + 3
  36.   end if
  37. end
  38.  
  39. on explode
  40.   puppetSound("grex")
  41.   puppetSprite(4, 1)
  42.   repeat with x = 7 to 14
  43.     puppetSprite(x, 1)
  44.   end repeat
  45.   repeat with x = 1 to 4
  46.     set the locH of sprite 4 to the locH of sprite 4 + 4
  47.     repeat with y = 7 to 14
  48.       set the locH of sprite y to the locH of sprite y + 4
  49.     end repeat
  50.     updateStage()
  51.     wait(2)
  52.     set the locH of sprite 4 to the locH of sprite 4 - 4
  53.     repeat with y = 7 to 14
  54.       set the locH of sprite y to the locH of sprite y - 4
  55.     end repeat
  56.     updateStage()
  57.     wait(2)
  58.   end repeat
  59.   puppetSprite(4, 0)
  60.   repeat with x = 7 to 14
  61.     puppetSprite(x, 0)
  62.   end repeat
  63.   set Gscore1 to Gscore1 - 40
  64. end
  65.